package com.hava.demo.springmvc.onlyone.controller.web.show;

import com.hava.demo.springmvc.onlyone.entity.OnlyOne;
import com.hava.demo.springmvc.onlyone.service.OnlyOneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by zhanpeng on 15-4-9.
 */

@Controller
@RequestMapping(value = "/demo/onlyone/page/listall")
public class OnlyOneListController {

    @Autowired
    private OnlyOneService onlyOneService;
    
    @RequestMapping(method = RequestMethod.GET)
    public String get() {
        List<OnlyOne> lists = onlyOneService.getAllOnlyOne();
        return "demo/onlyone/listall";
    }

    @RequestMapping(method = RequestMethod.POST)
    public String post(HttpServletRequest request) {
        return "demo/onlyone/listall";
    }
}